#include"test_draw_buffer.h"


#include<GL/glext.h>


static GLuint BufferName;
static const GLuint PositionSize = 6 * 2 * sizeof(GLfloat);
static const GLfloat PositionData[] =
{
    -0.2f,-0.2f,
    0.2f,-0.2f,
	 0.2f, 0.2f,
	 0.2f ,0.2f,
	-0.2f, 0.2f,
	-0.2f,-0.2f,
};
namespace test_draw_buffer
{

static const GLsizei VertexCount = 6;
void TestCase::paintGL()
    {
       glClear(GL_COLOR_BUFFER_BIT );

       OPENGL_CALL_CHECK(glGenBuffers(1, &BufferName));
       glBindBuffer(GL_ARRAY_BUFFER, BufferName);
       glBufferData(GL_ARRAY_BUFFER, PositionSize, PositionData, GL_STREAM_DRAW);
       glVertexPointer(2, GL_FLOAT, 0, 0);
       glEnableClientState(GL_VERTEX_ARRAY);
       glDrawArrays(GL_TRIANGLES, 0, VertexCount);
       glDisableClientState(GL_VERTEX_ARRAY);

    }

}
